How to host wordpress website on github or gitlab for free.​

How to use github/gitlab for wordpress hosting.

How to host wordpress website on github or gitlab for free.

Today, I am going to tell you how I use gitlab (or you can use github) for host WordPress website for free. Yes, you heard right host WordPress for free. Yay!

I am using gitlab for my free WordPress hosting as you can see. Basically I am using gitlab pages for hosting purpose. If you don’t know already, let me tell you that github and gitlab allows you to host static hosting but not dynamic hosting.

WordPress use PHP programming language and it runs on a serve. So it is for dynamic website.

Now you might thinking that github or gitlab allow you only static website so how you will host a dynamic website. Well Keep reading to find out.

To host wodpress website on github, you need to follow below steps carefully.

Install WordPress locally on your system

So the basically the trick is, we will generate static page of our blog from the locally installed wordpress and push all the pages to the git repo and host all the static pages which we will learn how to create them and voila!

First thing first, you need to install WordPress offline on your system.

To install WordPress you must have web server install on your system.

I recommend you to install XAMPP server if you are on windows, LAMP if you are using Linux or MAMP if you are using Mac.

Download and Install the web server after that you need to download WordPress. You can download  WordPress from here.

After Download, unzip your files into web server root directory. 

After unzip go localhost/wp-admin, then your configuration screen will open.

Complete the instruction given on your screen and you good to go and follow next step.

Install Plug-in to generate static pages

Now you have done 50% of work cheers!

Now the main part is to install this plug-in Simply Static.

This wonderful plug-in will help you to convert your WordPress website to HTML or static website.

Hover over Plugins in your Dashboard and select Add New from the menu.

wordpress install new plugin

After that type in the search at right side Simply Static and click on Install and after install click on Activate to activate it.

wordpress search

After activate, see at the left bottom there will be  simply static section, hover over and click on settings.

Select Use absolute URLs and then enter your domain name where you will host your website and in the bottom choose where to save files.

Convert WordPress Website to HTML

Finally its time to convert your website to HTML static pages.

Click on Generate in  the Simply Static section. Click on Generate Button and Boom your files will save to your directory  where you previously saved.

Now you are good to go and upload your files to github repo and turn on your github pages. Wait for some minutes and Congratulations for your new WordPress website for free hosting.

Bonus tip: You can use yoast seo plug-in and other plugins too and they will work good on gihthub.

If you have any query or just say hi. You can contact me at akshaybhati28@gmail.com 

I hope this will help someone. Good Day! 🙂